from rest_framework import serializers

from apps.match.models import MatchFood, MatchMeal, MatchStaple


class MatchSerializer(serializers.ModelSerializer):
    class Meta:
        model = MatchFood
        fields = '__all__' # 默认生成所有字段

    def validate(self,attrs):
        return attrs

    # def create(self, validated_data):
    #     print(validated_data)
    #     match_info = MatchMeal.objects.create(**validated_data)
    #     return match_info

class MatchMealSerializer(serializers.ModelSerializer):
    class Meta:
        model = MatchMeal
        fields = '__all__' # 默认生成所有字段

    def validate(self,attrs):
        return attrs


class MatchStapleSerializer(serializers.ModelSerializer):
    class Meta:
        model = MatchStaple
        fields = '__all__' # 默认生成所有字段

    def validate(self,attrs):
        return attrs